/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package exampleseverything.utils;

import java.io.FileWriter;
import java.io.FileReader;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.List;
import java.util.LinkedList;
import exampleseverything.beans.Alumno;
import exampleseverything.beans.Columna;
/**
 *
 * @author HellCoders
 */
public class FilesOp {

    public static void generateData()throws IOException {
        //initialize data
        String[] nombre = {"Jesus","Eduardo","Manuel","Sinhue","Carlos","Gregorio","Jorge","Odin","Faleg","Guillermo"};
        String[] ap_paterno = {"Valadez","Martinez","Peralta","Escobar","Asgard","Jimenez","Solis","Infante","Waltari","Rosales"};
        String[] ap_materno = {"Valadez","Martinez","Peralta","Escobar","Asgard","Jimenez","Solis","Infante","Waltari","Rosales"};
        int[] edad = {18,19,20,21,22,23,24};
        char[] grupo = {'A','B','C','D','F'};
        int[] grado = {1,2,3,4,5,6,7,8};

        //create the PrintWriter to write the data into the file
        PrintWriter pw = new PrintWriter(new FileWriter("src\\files\\alumnos.txt"));
        for(int i = 0;i < 50;i++) {
            //select a different nombre, ap_materno, ap_materno, edad, grupo & grado
            int nom = (int)(Math.random()*9);
            int ap = (int)(Math.random()*9);
            int am = (int)(Math.random()*9);
            int ed = (int)(Math.random()*6);
            int gpo = (int)(Math.random()*5);
            int gd = (int)(Math.random()*7);

            //format the line for the file
            pw.println(nombre[nom]+"-"+ap_paterno[ap]+"-"+ap_materno[am]+"-"+edad[ed]+"-"+grupo[gpo]+"-"+grado[gd]);
        }
        pw.close();
    }
}
